package com.mrd.serverconnect.pkg;

import java.io.DataInputStream;
import java.io.IOException;

/**
 * Created by liushenen on 2018/1/31.
 */

public class PKGBase {

    static class BaseReqData{
        byte[] head; //包头
        byte funCode; //功能编码

    }


    /**
     * 读取包头
     *
     * @param inputStream
     * @return
     * @throws IOException
     */
    public byte[] readHead(DataInputStream inputStream) throws IOException {
        byte[] head = new byte[7];
        inputStream.read(head);
        return head;
    }

    /**
     * 读取功能码
     * @param inputStream
     * @return
     * @throws IOException
     */
    public byte readfunCode(DataInputStream inputStream) throws IOException {
        byte funCode= inputStream.readByte();
        return funCode;
    }
}
